import { _decorator, Component, director, Label, Node } from 'cc';
import { audioTool } from '../utils/audioTool';
import { nodePool } from '../utils/nodePool';
import { gameConfig } from '../data/gameConfig';
import { emits } from '../data/enums';
import { LevelManager } from '../utils/LevelManager';
const { ccclass, property } = _decorator;

@ccclass('main')
export class main extends Component {
    
    start() {
        director.emit(emits.playerTx);
        director.on(emits.levelList, this.classicLevel, this);
        if (gameConfig.isBgm) {
            audioTool.ins.playMusic("bgm");
        }
    }

    classicLevel() {
        nodePool.ins.getPoolNode("levelView", this.node);
    }
    shop() {
        nodePool.ins.getPoolNode("shopView", this.node);
    }
    phb() {
        nodePool.ins.getPoolNode("phbView", this.node);
    }
    user() {
        //nodePool.ins.getPoolNode("userView",this.node);
    }
}


